﻿Module LoadItem
    Public Sub LoadItem(ByVal ItemVIRID As String)
        If InStr(ItemVIRID, "?") = 0 Then
            MainProgram.ItemData = MainProgram.GetFileContents(MainProgram.DirItems, MainProgram.sErr)
            ItemVIRID = Replace(ItemVIRID, "?", "")
        Else
            MainProgram.ItemData = MainProgram.CustomItemData
        End If
        If MainProgram.sErr = "" Then
            Dim tempvar As Integer = InStr(MainProgram.ItemData, "VIRID#" + ItemVIRID + "(")
            Dim tempvar2 As Integer
            If tempvar > 0 Then
                For tempvar2 = InStr(MainProgram.ItemData, "VIRID#" + ItemVIRID + "(") To Len(MainProgram.ItemData) Step 1
                    If Mid(MainProgram.ItemData, tempvar2, 1) = ")" Then
                        MainProgram.ItemData_VIRID = Replace(Mid(MainProgram.ItemData, tempvar + 7 + Len(LTrim(RTrim(ItemVIRID))), tempvar2 - (tempvar + 7 + Len(LTrim(RTrim(ItemVIRID))))), " ", "")
                        Exit For
                    End If
                Next
                tempvar = InStr(MainProgram.ItemData, "ITEMT#" + ItemVIRID + "(")
                For tempvar2 = InStr(MainProgram.ItemData, "ITEMT#" + ItemVIRID + "(") To Len(MainProgram.ItemData) Step 1
                    If Mid(MainProgram.ItemData, tempvar2, 1) = ")" Then
                        MainProgram.ItemData_ITEMT = Mid(MainProgram.ItemData, tempvar + 7 + Len(LTrim(RTrim(ItemVIRID))), tempvar2 - (tempvar + 7 + Len(LTrim(RTrim(ItemVIRID)))))
                        Exit For
                    End If
                Next
                tempvar = InStr(MainProgram.ItemData, "ITEMC#" + ItemVIRID + "(")
                For tempvar2 = InStr(MainProgram.ItemData, "ITEMC#" + ItemVIRID + "(") To Len(MainProgram.ItemData) Step 1
                    If Mid(MainProgram.ItemData, tempvar2, 1) = ")" Then
                        MainProgram.ItemData_ITEMC = Mid(MainProgram.ItemData, tempvar + 7 + Len(LTrim(RTrim(ItemVIRID))), tempvar2 - (tempvar + 7 + Len(LTrim(RTrim(ItemVIRID)))))
                        Exit For
                    End If
                Next
                tempvar = InStr(MainProgram.ItemData, "ITEMN#" + ItemVIRID + "(")
                For tempvar2 = InStr(MainProgram.ItemData, "ITEMN#" + ItemVIRID + "(") To Len(MainProgram.ItemData) Step 1
                    If Mid(MainProgram.ItemData, tempvar2, 1) = ")" Then
                        MainProgram.ItemData_ITEMN = Mid(MainProgram.ItemData, tempvar + 7 + Len(LTrim(RTrim(ItemVIRID))), tempvar2 - (tempvar + 7 + Len(LTrim(RTrim(ItemVIRID)))))
                        Exit For
                    End If
                Next
                tempvar = InStr(MainProgram.ItemData, "SHORT#" + ItemVIRID + "(")
                For tempvar2 = InStr(MainProgram.ItemData, "SHORT#" + ItemVIRID + "(") To Len(MainProgram.ItemData) Step 1
                    If Mid(MainProgram.ItemData, tempvar2, 1) = ")" Then
                        MainProgram.ItemData_SHORT = Mid(MainProgram.ItemData, tempvar + 7 + Len(LTrim(RTrim(ItemVIRID))), tempvar2 - (tempvar + 7 + Len(LTrim(RTrim(ItemVIRID)))))
                        Exit For
                    End If
                Next
                tempvar = InStr(MainProgram.ItemData, "LONGD#" + ItemVIRID + "(")
                For tempvar2 = InStr(MainProgram.ItemData, "LONGD#" + ItemVIRID + "(") To Len(MainProgram.ItemData) Step 1
                    If Mid(MainProgram.ItemData, tempvar2, 1) = ")" Then
                        MainProgram.ItemData_LONGD = Mid(MainProgram.ItemData, tempvar + 7 + Len(LTrim(RTrim(ItemVIRID))), tempvar2 - (tempvar + 7 + Len(LTrim(RTrim(ItemVIRID)))))
                        Exit For
                    End If
                Next
                tempvar = InStr(MainProgram.ItemData, "LOOKD#" + ItemVIRID + "(")
                For tempvar2 = InStr(MainProgram.ItemData, "LOOKD#" + ItemVIRID + "(") To Len(MainProgram.ItemData) Step 1
                    If Mid(MainProgram.ItemData, tempvar2, 1) = ")" Then
                        MainProgram.ItemData_LOOKD = Mid(MainProgram.ItemData, tempvar + 7 + Len(LTrim(RTrim(ItemVIRID))), tempvar2 - (tempvar + 7 + Len(LTrim(RTrim(ItemVIRID)))))
                        Exit For
                    End If
                Next
                tempvar = InStr(MainProgram.ItemData, "EQUIP#" + ItemVIRID + "(")
                For tempvar2 = InStr(MainProgram.ItemData, "EQUIP#" + ItemVIRID + "(") To Len(MainProgram.ItemData) Step 1
                    If Mid(MainProgram.ItemData, tempvar2, 1) = ")" Then
                        MainProgram.ItemData_ITEMT = Mid(MainProgram.ItemData, tempvar + 7 + Len(LTrim(RTrim(ItemVIRID))), tempvar2 - (tempvar + 7 + Len(LTrim(RTrim(ItemVIRID)))))
                        Exit For
                    End If
                Next
                tempvar = InStr(MainProgram.ItemData, "PARID#" + ItemVIRID + "(")
                For tempvar2 = InStr(MainProgram.ItemData, "PARID#" + ItemVIRID + "(") To Len(MainProgram.ItemData) Step 1
                    If Mid(MainProgram.ItemData, tempvar2, 1) = ")" Then
                        Dim tmp0 As Integer, tmp1 As Integer, tmp2 As Integer, tmp3 As Integer
                        Dim tmpA As String, tmpB As String = "", tmpC As String = ""
                        tmpA = Mid(MainProgram.ItemData, tempvar + 7 + Len(LTrim(RTrim(ItemVIRID))), tempvar2 - (tempvar + 7 + Len(LTrim(RTrim(ItemVIRID)))))
                        If Mid(tmpA, 1, 1) = "0" Then : MainProgram.ItemData_BasicType = "Miscellaneous"
                            MainProgram.ItemData_Weight = Mid(tmpA, 3, Len(tmpA))
                            MainProgram.ItemData_SexRequirement = "None"
                            MainProgram.ItemData_LevelRequirement = "None"
                            MainProgram.ItemData_ClassRequirement = "None"
                            MainProgram.ItemData_PurchasableAreas = "Unknown"
                        ElseIf Mid(tmpA, 1, 1) = "1" Then : MainProgram.ItemData_BasicType = "Armor"
                            MainProgram.ItemData_BashAC = "0" : MainProgram.ItemData_SlashAC = "0" : MainProgram.ItemData_PierceAC = "0"
                            MainProgram.ItemData_ExoticAC = "0" : MainProgram.ItemData_FistAC = "0"
                            For tmp0 = 1 To Len(tmpA) Step 1
                                If Mid(tmpA, tmp0, 1) = "," Then
                                    tmp1 += 1
                                    tmp3 = tmp2
                                    tmp2 = tmp0
                                    tmpB = "0"
                                End If
                                If tmp1 = 2 And tmpB <> "1" Then 'type
                                    tmpC = Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1)
                                    tmpB = "1"
                                    If tmpC = "000" Then : MainProgram.ItemData_TYPE = "Crown"
                                    ElseIf tmpC = "001" Then : MainProgram.ItemData_TYPE = "Chapeau"
                                    ElseIf tmpC = "002" Then : MainProgram.ItemData_TYPE = "Chaplet"
                                    ElseIf tmpC = "003" Then : MainProgram.ItemData_TYPE = "Coif"
                                    ElseIf tmpC = "004" Then : MainProgram.ItemData_TYPE = "Coronet"
                                    ElseIf tmpC = "005" Then : MainProgram.ItemData_TYPE = "Cowl"
                                    ElseIf tmpC = "006" Then : MainProgram.ItemData_TYPE = "Spectacles"
                                    ElseIf tmpC = "007" Then : MainProgram.ItemData_TYPE = "Tiara"
                                    ElseIf tmpC = "008" Then : MainProgram.ItemData_TYPE = "Eyeglasses"
                                    ElseIf tmpC = "009" Then : MainProgram.ItemData_TYPE = "Monocle"
                                    ElseIf tmpC = "010" Then : MainProgram.ItemData_TYPE = "Wreath"
                                    ElseIf tmpC = "011" Then : MainProgram.ItemData_TYPE = "Circlet"
                                    ElseIf tmpC = "012" Then : MainProgram.ItemData_TYPE = "Mask"
                                    ElseIf tmpC = "013" Then : MainProgram.ItemData_TYPE = "Headdress"
                                    ElseIf tmpC = "014" Then : MainProgram.ItemData_TYPE = "Hood"
                                    ElseIf tmpC = "015" Then : MainProgram.ItemData_TYPE = "Cap"
                                    ElseIf tmpC = "016" Then : MainProgram.ItemData_TYPE = "Helm"
                                    ElseIf tmpC = "017" Then : MainProgram.ItemData_TYPE = "Full Helm"
                                    ElseIf tmpC = "018" Then : MainProgram.ItemData_TYPE = "Horned Helm"
                                    ElseIf tmpC = "019" Then : MainProgram.ItemData_TYPE = "Skull Cap"
                                    ElseIf tmpC = "020" Then : MainProgram.ItemData_TYPE = "Face Guard"
                                    ElseIf tmpC = "021" Then : MainProgram.ItemData_TYPE = "Face Plate"
                                    ElseIf tmpC = "022" Then : MainProgram.ItemData_TYPE = "Gorget"
                                    ElseIf tmpC = "023" Then : MainProgram.ItemData_TYPE = "Amulet"
                                    ElseIf tmpC = "024" Then : MainProgram.ItemData_TYPE = "Choker"
                                    ElseIf tmpC = "025" Then : MainProgram.ItemData_TYPE = "Locket"
                                    ElseIf tmpC = "026" Then : MainProgram.ItemData_TYPE = "Medallion"
                                    ElseIf tmpC = "027" Then : MainProgram.ItemData_TYPE = "Neckband"
                                    ElseIf tmpC = "028" Then : MainProgram.ItemData_TYPE = "Necklace"
                                    ElseIf tmpC = "029" Then : MainProgram.ItemData_TYPE = "Mark"
                                    ElseIf tmpC = "030" Then : MainProgram.ItemData_TYPE = "Pendant"
                                    ElseIf tmpC = "031" Then : MainProgram.ItemData_TYPE = "Icon"
                                    ElseIf tmpC = "032" Then : MainProgram.ItemData_TYPE = "Talisman"
                                    ElseIf tmpC = "033" Then : MainProgram.ItemData_TYPE = "Amice"
                                    ElseIf tmpC = "034" Then : MainProgram.ItemData_TYPE = "Pauldrons"
                                    ElseIf tmpC = "035" Then : MainProgram.ItemData_TYPE = "Mantle"
                                    ElseIf tmpC = "036" Then : MainProgram.ItemData_TYPE = "Studded Mantle"
                                    ElseIf tmpC = "037" Then : MainProgram.ItemData_TYPE = "Shoulder Pads"
                                    ElseIf tmpC = "038" Then : MainProgram.ItemData_TYPE = "Spaulders"
                                    ElseIf tmpC = "039" Then : MainProgram.ItemData_TYPE = "Scaled Shoulders"
                                    ElseIf tmpC = "040" Then : MainProgram.ItemData_TYPE = "Splint Shoulders"
                                    ElseIf tmpC = "041" Then : MainProgram.ItemData_TYPE = "Half-plate Shoulders"
                                    ElseIf tmpC = "042" Then : MainProgram.ItemData_TYPE = "Plate Shoulders"
                                    ElseIf tmpC = "043" Then : MainProgram.ItemData_TYPE = "Armlets"
                                    ElseIf tmpC = "044" Then : MainProgram.ItemData_TYPE = "Armband"
                                    ElseIf tmpC = "045" Then : MainProgram.ItemData_TYPE = "Arm-guards"
                                    ElseIf tmpC = "046" Then : MainProgram.ItemData_TYPE = "Arm Wraps"
                                    ElseIf tmpC = "047" Then : MainProgram.ItemData_TYPE = "Cuffs"
                                    ElseIf tmpC = "048" Then : MainProgram.ItemData_TYPE = "Wristband"
                                    ElseIf tmpC = "049" Then : MainProgram.ItemData_TYPE = "Bracers"
                                    ElseIf tmpC = "050" Then : MainProgram.ItemData_TYPE = "Bracelet"
                                    ElseIf tmpC = "051" Then : MainProgram.ItemData_TYPE = "Shackles"
                                    ElseIf tmpC = "052" Then : MainProgram.ItemData_TYPE = "Bindings"
                                    ElseIf tmpC = "053" Then : MainProgram.ItemData_TYPE = "Gloves"
                                    ElseIf tmpC = "054" Then : MainProgram.ItemData_TYPE = "Mittens"
                                    ElseIf tmpC = "055" Then : MainProgram.ItemData_TYPE = "Handwraps"
                                    ElseIf tmpC = "056" Then : MainProgram.ItemData_TYPE = "Handguards"
                                    ElseIf tmpC = "057" Then : MainProgram.ItemData_TYPE = "Gauntlets"
                                    ElseIf tmpC = "058" Then : MainProgram.ItemData_TYPE = "Chainmail Gauntlets"
                                    ElseIf tmpC = "059" Then : MainProgram.ItemData_TYPE = "Scalemail Gauntlets"
                                    ElseIf tmpC = "060" Then : MainProgram.ItemData_TYPE = "Platemail Gauntlets"
                                    ElseIf tmpC = "061" Then : MainProgram.ItemData_TYPE = "Platemail"
                                    ElseIf tmpC = "062" Then : MainProgram.ItemData_TYPE = "Ringmail"
                                    ElseIf tmpC = "063" Then : MainProgram.ItemData_TYPE = "Chain Cuirass"
                                    ElseIf tmpC = "064" Then : MainProgram.ItemData_TYPE = "Half-plate"
                                    ElseIf tmpC = "065" Then : MainProgram.ItemData_TYPE = "Chestplate"
                                    ElseIf tmpC = "066" Then : MainProgram.ItemData_TYPE = "Chestguard"
                                    ElseIf tmpC = "067" Then : MainProgram.ItemData_TYPE = "Scalemail"
                                    ElseIf tmpC = "068" Then : MainProgram.ItemData_TYPE = "Splintmail"
                                    ElseIf tmpC = "069" Then : MainProgram.ItemData_TYPE = "Studded Tunic"
                                    ElseIf tmpC = "070" Then : MainProgram.ItemData_TYPE = "Tunic"
                                    ElseIf tmpC = "071" Then : MainProgram.ItemData_TYPE = "Vestment"
                                    ElseIf tmpC = "072" Then : MainProgram.ItemData_TYPE = "Hauberk"
                                    ElseIf tmpC = "073" Then : MainProgram.ItemData_TYPE = "Field Plate"
                                    ElseIf tmpC = "074" Then : MainProgram.ItemData_TYPE = "Banded Mail"
                                    ElseIf tmpC = "075" Then : MainProgram.ItemData_TYPE = "Brigandine Armor"
                                    ElseIf tmpC = "076" Then : MainProgram.ItemData_TYPE = "Robe"
                                    ElseIf tmpC = "077" Then : MainProgram.ItemData_TYPE = "Raiment"
                                    ElseIf tmpC = "078" Then : MainProgram.ItemData_TYPE = "Tabard"
                                    ElseIf tmpC = "079" Then : MainProgram.ItemData_TYPE = "Doublet"
                                    ElseIf tmpC = "080" Then : MainProgram.ItemData_TYPE = "Chemise"
                                    ElseIf tmpC = "081" Then : MainProgram.ItemData_TYPE = "Lorica Segmentata"
                                    ElseIf tmpC = "082" Then : MainProgram.ItemData_TYPE = "Lamellar"
                                    ElseIf tmpC = "083" Then : MainProgram.ItemData_TYPE = "Shawl"
                                    ElseIf tmpC = "084" Then : MainProgram.ItemData_TYPE = "Cape"
                                    ElseIf tmpC = "085" Then : MainProgram.ItemData_TYPE = "Capelet"
                                    ElseIf tmpC = "086" Then : MainProgram.ItemData_TYPE = "Cloak"
                                    ElseIf tmpC = "087" Then : MainProgram.ItemData_TYPE = "Heavy Cloak"
                                    ElseIf tmpC = "088" Then : MainProgram.ItemData_TYPE = "Battle Cloak"
                                    ElseIf tmpC = "089" Then : MainProgram.ItemData_TYPE = "Royal Cloak"
                                    ElseIf tmpC = "090" Then : MainProgram.ItemData_TYPE = "Girdle"
                                    ElseIf tmpC = "091" Then : MainProgram.ItemData_TYPE = "Belt"
                                    ElseIf tmpC = "092" Then : MainProgram.ItemData_TYPE = "Cord"
                                    ElseIf tmpC = "093" Then : MainProgram.ItemData_TYPE = "Waistwrap"
                                    ElseIf tmpC = "094" Then : MainProgram.ItemData_TYPE = "Sash"
                                    ElseIf tmpC = "095" Then : MainProgram.ItemData_TYPE = "Genoillere"
                                    ElseIf tmpC = "096" Then : MainProgram.ItemData_TYPE = "Bloomers"
                                    ElseIf tmpC = "097" Then : MainProgram.ItemData_TYPE = "Breeches"
                                    ElseIf tmpC = "098" Then : MainProgram.ItemData_TYPE = "Trousers"
                                    ElseIf tmpC = "099" Then : MainProgram.ItemData_TYPE = "Leggings"
                                    ElseIf tmpC = "100" Then : MainProgram.ItemData_TYPE = "Legguards"
                                    ElseIf tmpC = "101" Then : MainProgram.ItemData_TYPE = "Skirt"
                                    ElseIf tmpC = "102" Then : MainProgram.ItemData_TYPE = "Split Skirt"
                                    ElseIf tmpC = "103" Then : MainProgram.ItemData_TYPE = "Tights"
                                    ElseIf tmpC = "104" Then : MainProgram.ItemData_TYPE = "Pantaloons"
                                    ElseIf tmpC = "105" Then : MainProgram.ItemData_TYPE = "Scale Leggings"
                                    ElseIf tmpC = "106" Then : MainProgram.ItemData_TYPE = "Splint Leggings"
                                    ElseIf tmpC = "107" Then : MainProgram.ItemData_TYPE = "Half-plate Leggings"
                                    ElseIf tmpC = "108" Then : MainProgram.ItemData_TYPE = "Plate Leggings"
                                    ElseIf tmpC = "109" Then : MainProgram.ItemData_TYPE = "Chainmail Leggings"
                                    ElseIf tmpC = "110" Then : MainProgram.ItemData_TYPE = "Greaves"
                                    ElseIf tmpC = "111" Then : MainProgram.ItemData_TYPE = "Slippers"
                                    ElseIf tmpC = "112" Then : MainProgram.ItemData_TYPE = "Sandals"
                                    ElseIf tmpC = "113" Then : MainProgram.ItemData_TYPE = "Stalkers"
                                    ElseIf tmpC = "114" Then : MainProgram.ItemData_TYPE = "Footguards"
                                    ElseIf tmpC = "115" Then : MainProgram.ItemData_TYPE = "Scale Boots"
                                    ElseIf tmpC = "116" Then : MainProgram.ItemData_TYPE = "Splint Boots"
                                    ElseIf tmpC = "117" Then : MainProgram.ItemData_TYPE = "Half-plate Boots"
                                    ElseIf tmpC = "118" Then : MainProgram.ItemData_TYPE = "Plate Boots"
                                    ElseIf tmpC = "119" Then : MainProgram.ItemData_TYPE = "Anklet"
                                    ElseIf tmpC = "120" Then : MainProgram.ItemData_TYPE = "Boots"
                                    ElseIf tmpC = "121" Then : MainProgram.ItemData_TYPE = "Longboots"
                                    ElseIf tmpC = "122" Then : MainProgram.ItemData_TYPE = "Footgaurds"
                                    ElseIf tmpC = "123" Then : MainProgram.ItemData_TYPE = "Ring"
                                    ElseIf tmpC = "124" Then : MainProgram.ItemData_TYPE = "Band"
                                    ElseIf tmpC = "125" Then : MainProgram.ItemData_TYPE = "Thumb Ring"
                                    ElseIf tmpC = "126" Then : MainProgram.ItemData_TYPE = "Wedding Ring"
                                    ElseIf tmpC = "127" Then : MainProgram.ItemData_TYPE = "Engagement Ring"
                                    ElseIf tmpC = "128" Then : MainProgram.ItemData_TYPE = "Signet Ring"
                                    ElseIf tmpC = "129" Then : MainProgram.ItemData_TYPE = "Blood Ring"
                                    ElseIf tmpC = "130" Then : MainProgram.ItemData_TYPE = "Aegis"
                                    ElseIf tmpC = "131" Then : MainProgram.ItemData_TYPE = "Scutum"
                                    ElseIf tmpC = "132" Then : MainProgram.ItemData_TYPE = "Targe"
                                    ElseIf tmpC = "133" Then : MainProgram.ItemData_TYPE = "Roundel"
                                    ElseIf tmpC = "134" Then : MainProgram.ItemData_TYPE = "Buckler"
                                    ElseIf tmpC = "135" Then : MainProgram.ItemData_TYPE = "Disc Shield"
                                    ElseIf tmpC = "136" Then : MainProgram.ItemData_TYPE = "Heater Shield"
                                    ElseIf tmpC = "137" Then : MainProgram.ItemData_TYPE = "Bulwark"
                                    ElseIf tmpC = "138" Then : MainProgram.ItemData_TYPE = "Tower Shield"
                                    ElseIf tmpC = "139" Then : MainProgram.ItemData_TYPE = "Kite Shield"
                                    End If
                                ElseIf tmp1 = 3 And tmpB <> "2" Then 'material
                                    tmpC = Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1)
                                    tmpB = "2"
                                    If tmpC = "000" Then : MainProgram.ItemData_Material = "Magnesium"
                                    ElseIf tmpC = "001" Then : MainProgram.ItemData_Material = "Aluminium"
                                    ElseIf tmpC = "002" Then : MainProgram.ItemData_Material = "Duralumin"
                                    ElseIf tmpC = "003" Then : MainProgram.ItemData_Material = "Silumin"
                                    ElseIf tmpC = "004" Then : MainProgram.ItemData_Material = "Magnalium"
                                    ElseIf tmpC = "005" Then : MainProgram.ItemData_Material = "Alnico"
                                    ElseIf tmpC = "006" Then : MainProgram.ItemData_Material = "Potassium"
                                    ElseIf tmpC = "007" Then : MainProgram.ItemData_Material = "Iron"
                                    ElseIf tmpC = "008" Then : MainProgram.ItemData_Material = "Steel"
                                    ElseIf tmpC = "009" Then : MainProgram.ItemData_Material = "Chromoly"
                                    ElseIf tmpC = "010" Then : MainProgram.ItemData_Material = "Invar"
                                    ElseIf tmpC = "011" Then : MainProgram.ItemData_Material = "Cobalt"
                                    ElseIf tmpC = "012" Then : MainProgram.ItemData_Material = "Stellite"
                                    ElseIf tmpC = "013" Then : MainProgram.ItemData_Material = "Vitallium"
                                    ElseIf tmpC = "014" Then : MainProgram.ItemData_Material = "Nickel"
                                    ElseIf tmpC = "015" Then : MainProgram.ItemData_Material = "Chromel"
                                    ElseIf tmpC = "016" Then : MainProgram.ItemData_Material = "Nichrome"
                                    ElseIf tmpC = "017" Then : MainProgram.ItemData_Material = "Cupronickel"
                                    ElseIf tmpC = "018" Then : MainProgram.ItemData_Material = "Copper"
                                    ElseIf tmpC = "019" Then : MainProgram.ItemData_Material = "Billon"
                                    ElseIf tmpC = "020" Then : MainProgram.ItemData_Material = "Brass"
                                    ElseIf tmpC = "021" Then : MainProgram.ItemData_Material = "Tombac"
                                    ElseIf tmpC = "022" Then : MainProgram.ItemData_Material = "Bronze"
                                    ElseIf tmpC = "023" Then : MainProgram.ItemData_Material = "Hepatizon"
                                    ElseIf tmpC = "024" Then : MainProgram.ItemData_Material = "Shakudo"
                                    ElseIf tmpC = "025" Then : MainProgram.ItemData_Material = "Tumbaga"
                                    ElseIf tmpC = "026" Then : MainProgram.ItemData_Material = "Zinc"
                                    ElseIf tmpC = "027" Then : MainProgram.ItemData_Material = "Gallium"
                                    ElseIf tmpC = "028" Then : MainProgram.ItemData_Material = "Zirconium"
                                    ElseIf tmpC = "029" Then : MainProgram.ItemData_Material = "Silver"
                                    ElseIf tmpC = "030" Then : MainProgram.ItemData_Material = "Indium"
                                    ElseIf tmpC = "031" Then : MainProgram.ItemData_Material = "Tin"
                                    ElseIf tmpC = "032" Then : MainProgram.ItemData_Material = "Gold"
                                    ElseIf tmpC = "033" Then : MainProgram.ItemData_Material = "Mercury"
                                    ElseIf tmpC = "034" Then : MainProgram.ItemData_Material = "Lead"
                                    ElseIf tmpC = "035" Then : MainProgram.ItemData_Material = "Bismuth"
                                    ElseIf tmpC = "036" Then : MainProgram.ItemData_Material = "Uranium"
                                    ElseIf tmpC = "037" Then : MainProgram.ItemData_Material = "Agate"
                                    ElseIf tmpC = "038" Then : MainProgram.ItemData_Material = "Chrysoberyl"
                                    ElseIf tmpC = "039" Then : MainProgram.ItemData_Material = "Alexandrite"
                                    ElseIf tmpC = "040" Then : MainProgram.ItemData_Material = "Cymophane"
                                    ElseIf tmpC = "041" Then : MainProgram.ItemData_Material = "Emerald"
                                    ElseIf tmpC = "042" Then : MainProgram.ItemData_Material = "Bixbite"
                                    ElseIf tmpC = "043" Then : MainProgram.ItemData_Material = "Aquamarine"
                                    ElseIf tmpC = "044" Then : MainProgram.ItemData_Material = "Morganite"
                                    ElseIf tmpC = "045" Then : MainProgram.ItemData_Material = "Goshenite"
                                    ElseIf tmpC = "046" Then : MainProgram.ItemData_Material = "Golden Beryl"
                                    ElseIf tmpC = "047" Then : MainProgram.ItemData_Material = "Heliodor"
                                    ElseIf tmpC = "048" Then : MainProgram.ItemData_Material = "Maxixe"
                                    ElseIf tmpC = "049" Then : MainProgram.ItemData_Material = "Chrysocolla"
                                    ElseIf tmpC = "050" Then : MainProgram.ItemData_Material = "Chrysoprase"
                                    ElseIf tmpC = "051" Then : MainProgram.ItemData_Material = "Diamond"
                                    ElseIf tmpC = "052" Then : MainProgram.ItemData_Material = "Feldspar"
                                    ElseIf tmpC = "053" Then : MainProgram.ItemData_Material = "Garnet"
                                    ElseIf tmpC = "054" Then : MainProgram.ItemData_Material = "Hematite"
                                    ElseIf tmpC = "055" Then : MainProgram.ItemData_Material = "Jade"
                                    ElseIf tmpC = "056" Then : MainProgram.ItemData_Material = "Jasper"
                                    ElseIf tmpC = "057" Then : MainProgram.ItemData_Material = "Kunzite"
                                    ElseIf tmpC = "058" Then : MainProgram.ItemData_Material = "Lapis"
                                    ElseIf tmpC = "059" Then : MainProgram.ItemData_Material = "Malachite"
                                    ElseIf tmpC = "060" Then : MainProgram.ItemData_Material = "Obsidian"
                                    ElseIf tmpC = "061" Then : MainProgram.ItemData_Material = "Olivine"
                                    ElseIf tmpC = "062" Then : MainProgram.ItemData_Material = "Pyrite"
                                    ElseIf tmpC = "063" Then : MainProgram.ItemData_Material = "Citrine"
                                    ElseIf tmpC = "064" Then : MainProgram.ItemData_Material = "Ruby"
                                    ElseIf tmpC = "065" Then : MainProgram.ItemData_Material = "Sapphire"
                                    ElseIf tmpC = "066" Then : MainProgram.ItemData_Material = "Sugilite"
                                    ElseIf tmpC = "067" Then : MainProgram.ItemData_Material = "Tanzanite"
                                    ElseIf tmpC = "068" Then : MainProgram.ItemData_Material = "Topaz"
                                    ElseIf tmpC = "069" Then : MainProgram.ItemData_Material = "Turquoise"
                                    ElseIf tmpC = "070" Then : MainProgram.ItemData_Material = "Tourmaline"
                                    ElseIf tmpC = "071" Then : MainProgram.ItemData_Material = "Zircon"
                                    ElseIf tmpC = "072" Then : MainProgram.ItemData_Material = "Andalusite"
                                    ElseIf tmpC = "073" Then : MainProgram.ItemData_Material = "Benitoite"
                                    ElseIf tmpC = "074" Then : MainProgram.ItemData_Material = "Onyx"
                                    ElseIf tmpC = "075" Then : MainProgram.ItemData_Material = "Ammolite"
                                    ElseIf tmpC = "076" Then : MainProgram.ItemData_Material = "Coral"
                                    ElseIf tmpC = "077" Then : MainProgram.ItemData_Material = "Ivory"
                                    ElseIf tmpC = "078" Then : MainProgram.ItemData_Material = "Pearl"
                                    ElseIf tmpC = "079" Then : MainProgram.ItemData_Material = "Bone"
                                    ElseIf tmpC = "080" Then : MainProgram.ItemData_Material = "Lignite"
                                    ElseIf tmpC = "081" Then : MainProgram.ItemData_Material = "Platinum"
                                    ElseIf tmpC = "082" Then : MainProgram.ItemData_Material = "Palladium"
                                    ElseIf tmpC = "083" Then : MainProgram.ItemData_Material = "Glass"
                                    ElseIf tmpC = "084" Then : MainProgram.ItemData_Material = "Chestnut"
                                    ElseIf tmpC = "085" Then : MainProgram.ItemData_Material = "Basswood"
                                    ElseIf tmpC = "086" Then : MainProgram.ItemData_Material = "Dogwood"
                                    ElseIf tmpC = "087" Then : MainProgram.ItemData_Material = "Mahogany"
                                    ElseIf tmpC = "088" Then : MainProgram.ItemData_Material = "Maple"
                                    ElseIf tmpC = "089" Then : MainProgram.ItemData_Material = "Red Oak"
                                    ElseIf tmpC = "090" Then : MainProgram.ItemData_Material = "Rosewood"
                                    ElseIf tmpC = "091" Then : MainProgram.ItemData_Material = "Bamboo"
                                    ElseIf tmpC = "092" Then : MainProgram.ItemData_Material = "Wool"
                                    ElseIf tmpC = "093" Then : MainProgram.ItemData_Material = "Cotton"
                                    ElseIf tmpC = "094" Then : MainProgram.ItemData_Material = "Silk"
                                    ElseIf tmpC = "095" Then : MainProgram.ItemData_Material = "Spidersilk"
                                    ElseIf tmpC = "096" Then : MainProgram.ItemData_Material = "Linen"
                                    ElseIf tmpC = "097" Then : MainProgram.ItemData_Material = "Ramie"
                                    ElseIf tmpC = "098" Then : MainProgram.ItemData_Material = "Hemp"
                                    ElseIf tmpC = "099" Then : MainProgram.ItemData_Material = "Nettle"
                                    ElseIf tmpC = "100" Then : MainProgram.ItemData_Material = "Raffia"
                                    ElseIf tmpC = "101" Then : MainProgram.ItemData_Material = "Jute"
                                    ElseIf tmpC = "102" Then : MainProgram.ItemData_Material = "Barkcloth"
                                    ElseIf tmpC = "103" Then : MainProgram.ItemData_Material = "Batiste"
                                    ElseIf tmpC = "104" Then : MainProgram.ItemData_Material = "Bombazine"
                                    ElseIf tmpC = "105" Then : MainProgram.ItemData_Material = "Burlap"
                                    ElseIf tmpC = "106" Then : MainProgram.ItemData_Material = "Buckram"
                                    ElseIf tmpC = "107" Then : MainProgram.ItemData_Material = "Canvas"
                                    ElseIf tmpC = "108" Then : MainProgram.ItemData_Material = "Chino"
                                    ElseIf tmpC = "109" Then : MainProgram.ItemData_Material = "Crape"
                                    ElseIf tmpC = "110" Then : MainProgram.ItemData_Material = "Harris Tweed"
                                    ElseIf tmpC = "111" Then : MainProgram.ItemData_Material = "Hodden"
                                    ElseIf tmpC = "112" Then : MainProgram.ItemData_Material = "Serge"
                                    ElseIf tmpC = "113" Then : MainProgram.ItemData_Material = "Moleskin"
                                    ElseIf tmpC = "114" Then : MainProgram.ItemData_Material = "Flannel"
                                    ElseIf tmpC = "115" Then : MainProgram.ItemData_Material = "Camlet"
                                    ElseIf tmpC = "116" Then : MainProgram.ItemData_Material = "Brocade"
                                    ElseIf tmpC = "117" Then : MainProgram.ItemData_Material = "Damask"
                                    ElseIf tmpC = "118" Then : MainProgram.ItemData_Material = "Polar Fleece"
                                    ElseIf tmpC = "119" Then : MainProgram.ItemData_Material = "Velvet"
                                    ElseIf tmpC = "120" Then : MainProgram.ItemData_Material = "Zibeline"
                                    ElseIf tmpC = "121" Then : MainProgram.ItemData_Material = "Felt"
                                    ElseIf tmpC = "122" Then : MainProgram.ItemData_Material = "Tulle"
                                    ElseIf tmpC = "123" Then : MainProgram.ItemData_Material = "Fur"
                                    ElseIf tmpC = "124" Then : MainProgram.ItemData_Material = "Light Leather"
                                    ElseIf tmpC = "125" Then : MainProgram.ItemData_Material = "Medium Leather"
                                    ElseIf tmpC = "126" Then : MainProgram.ItemData_Material = "Heavy Leather"
                                    ElseIf tmpC = "127" Then : MainProgram.ItemData_Material = "Aniline Leather"
                                    ElseIf tmpC = "128" Then : MainProgram.ItemData_Material = "Boiled Leather"
                                    ElseIf tmpC = "129" Then : MainProgram.ItemData_Material = "Shell Cordovan"
                                    ElseIf tmpC = "130" Then : MainProgram.ItemData_Material = "Nappa Leather"
                                    ElseIf tmpC = "131" Then : MainProgram.ItemData_Material = "Nubuck"
                                    ElseIf tmpC = "132" Then : MainProgram.ItemData_Material = "Shagreen"
                                    ElseIf tmpC = "133" Then : MainProgram.ItemData_Material = "Suede"
                                    ElseIf tmpC = "134" Then : MainProgram.ItemData_Material = "Sequin"
                                    ElseIf tmpC = "135" Then : MainProgram.ItemData_Material = "Millefiori"
                                    ElseIf tmpC = "136" Then : MainProgram.ItemData_Material = "Chevron Beads"
                                    ElseIf tmpC = "137" Then : MainProgram.ItemData_Material = "Cinnabar Beads"
                                    ElseIf tmpC = "138" Then : MainProgram.ItemData_Material = "Dragon Scale"
                                    ElseIf tmpC = "139" Then : MainProgram.ItemData_Material = "Wyrm Scale"
                                    ElseIf tmpC = "140" Then : MainProgram.ItemData_Material = "Chitin"
                                    ElseIf tmpC = "141" Then : MainProgram.ItemData_Material = "Flesh"
                                    End If
                                ElseIf tmp1 = 4 And tmpB <> "3" Then 'craftsmanship
                                    tmpC = Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1)
                                    tmpB = "3"
                                    If tmpC = "00" Then : MainProgram.ItemData_Craftsmanship = "Trash"
                                    ElseIf tmpC = "01" Then : MainProgram.ItemData_Craftsmanship = "Crude"
                                    ElseIf tmpC = "02" Then : MainProgram.ItemData_Craftsmanship = "Shoddy"
                                    ElseIf tmpC = "03" Then : MainProgram.ItemData_Craftsmanship = "Poor"
                                    ElseIf tmpC = "04" Then : MainProgram.ItemData_Craftsmanship = "Inferior"
                                    ElseIf tmpC = "05" Then : MainProgram.ItemData_Craftsmanship = "Adequate"
                                    ElseIf tmpC = "06" Then : MainProgram.ItemData_Craftsmanship = "Acceptable"
                                    ElseIf tmpC = "07" Then : MainProgram.ItemData_Craftsmanship = "Average"
                                    ElseIf tmpC = "08" Then : MainProgram.ItemData_Craftsmanship = "Fine"
                                    ElseIf tmpC = "09" Then : MainProgram.ItemData_Craftsmanship = "Exceptional"
                                    ElseIf tmpC = "10" Then : MainProgram.ItemData_Craftsmanship = "Flawless"
                                    ElseIf tmpC = "11" Then : MainProgram.ItemData_Craftsmanship = "Masterwork"
                                    End If
                                ElseIf tmp1 = 5 And tmpB <> "4" Then 'quality
                                    tmpC = Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1)
                                    tmpB = "4"
                                    If tmpC = "0" Then : MainProgram.ItemData_Quality = "Standard"
                                    ElseIf tmpC = "1" Then : MainProgram.ItemData_Quality = "Magical"
                                    ElseIf tmpC = "2" Then : MainProgram.ItemData_Quality = "Rare"
                                    ElseIf tmpC = "3" Then : MainProgram.ItemData_Quality = "Epic"
                                    End If
                                ElseIf tmp1 = 6 And tmpB <> "5" Then 'bashac
                                    MainProgram.ItemData_BashAC = Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1)
                                    tmpB = "5"
                                ElseIf tmp1 = 7 And tmpB <> "6" Then 'slashac
                                    MainProgram.ItemData_SlashAC = Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1)
                                    tmpB = "6"
                                ElseIf tmp1 = 8 And tmpB <> "7" Then 'pierceac
                                    MainProgram.ItemData_PierceAC = Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1)
                                    tmpB = "7"
                                ElseIf tmp1 = 9 And tmpB <> "8" Then 'fistac
                                    MainProgram.ItemData_FistAC = Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1)
                                    tmpB = "8"
                                ElseIf tmp1 = 10 And tmpB <> "9" Then 'exoticac
                                    MainProgram.ItemData_ExoticAC = Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1)
                                    tmpB = "9"
                                ElseIf tmp1 = 11 And tmpB <> "10" Then 'sex req
                                    If Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1) = "N" Then
                                        MainProgram.ItemData_SexRequirement = "None"
                                    ElseIf Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1) = "M" Then
                                        MainProgram.ItemData_SexRequirement = "Male"
                                    ElseIf Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1) = "F" Then
                                        MainProgram.ItemData_SexRequirement = "Female"
                                    End If
                                    MainProgram.ItemData_ClassRequirement = "None"
                                    tmpB = "10"
                                ElseIf tmp1 = 12 And tmpB <> "11" Then 'levelreq
                                    MainProgram.ItemData_LevelRequirement = LTrim(Str(Val(Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1))))
                                    tmpB = "11"
                                ElseIf tmp1 = 13 And tmpB <> "12" Then 'proficiencyreq
                                    MainProgram.ItemData_ProfReq = Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1)
                                    tmpB = "12"
                                ElseIf tmp1 = 14 And tmpB <> "13" Then 'weight
                                    MainProgram.ItemData_Weight = Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1)
                                    tmpB = "13"
                                ElseIf tmp1 = 15 And tmpB <> "14" Then 'durabilitycount : durability %
                                    tmpC = Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1)
                                    MainProgram.ItemData_DurabilityCount = LTrim(Str(Val(Mid(tmpC, 1, 3))))
                                    MainProgram.ItemData_DurabilityPerc = LTrim(Str(Val(Mid(tmpC, 5, 3))))
                                    tmpB = "14"
                                ElseIf tmp1 = 16 And tmpB <> "15" Then 'affects | more affects 
                                    tmpC = Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1)
                                    If LCase(tmpC) <> "none" Then
                                        If InStr(tmpC, "|") Then
                                            For tmp3 = 1 To Len(tmpC) Step 1
                                                If Mid(tmpC, tmp3, 1) = "|" Then
                                                    MainProgram.ItemData_Affect1 = Mid(tmpC, 1, tmp3 - 1)
                                                    MainProgram.ItemData_Affect2 = Mid(tmpC, tmp3 + 1, Len(tmpC))
                                                    Exit For
                                                End If
                                            Next
                                        Else
                                            MainProgram.ItemData_Affect1 = tmpC
                                            MainProgram.ItemData_Affect2 = "None"
                                        End If
                                    Else
                                        MainProgram.ItemData_Affect1 = "None"
                                        MainProgram.ItemData_Affect2 = "None"
                                    End If
                                    'purchasable area(s)
                                    MainProgram.ItemData_PurchasableAreas = Mid(tmpA, tmp2 + 1, Len(tmpA))
                                    tmpB = "15"
                                    Exit For
                                End If
                            Next
                        ElseIf Mid(tmpA, 1, 1) = "2" Then : MainProgram.ItemData_BasicType = "Weapon"
                            For tmp0 = 1 To Len(tmpA) Step 1
                                If Mid(tmpA, tmp0, 1) = "," Then
                                    tmp1 += 1
                                    tmp3 = tmp2
                                    tmp2 = tmp0
                                    tmpB = "0"
                                End If
                                If tmp1 = 2 And tmpB <> "1" Then 'type
                                    tmpC = Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1)
                                    tmpB = "1"
                                    If tmpC = "00" Then : MainProgram.ItemData_TYPE = "Seax"
                                    ElseIf tmpC = "01" Then : MainProgram.ItemData_TYPE = "Stiletto"
                                    ElseIf tmpC = "02" Then : MainProgram.ItemData_TYPE = "Pugio"
                                    ElseIf tmpC = "03" Then : MainProgram.ItemData_TYPE = "Poniard"
                                    ElseIf tmpC = "04" Then : MainProgram.ItemData_TYPE = "Dirk"
                                    ElseIf tmpC = "05" Then : MainProgram.ItemData_TYPE = "Dagger"
                                    ElseIf tmpC = "06" Then : MainProgram.ItemData_TYPE = "Pickaxe"
                                    ElseIf tmpC = "07" Then : MainProgram.ItemData_TYPE = "Katar"
                                    ElseIf tmpC = "08" Then : MainProgram.ItemData_TYPE = "Cestus"
                                    ElseIf tmpC = "09" Then : MainProgram.ItemData_TYPE = "Shortbow"
                                    ElseIf tmpC = "10" Then : MainProgram.ItemData_TYPE = "Longbow"
                                    ElseIf tmpC = "11" Then : MainProgram.ItemData_TYPE = "Composite Bow"
                                    ElseIf tmpC = "12" Then : MainProgram.ItemData_TYPE = "Shuriken"
                                    ElseIf tmpC = "13" Then : MainProgram.ItemData_TYPE = "Darts"
                                    ElseIf tmpC = "14" Then : MainProgram.ItemData_TYPE = "Tomahawk Axe"
                                    ElseIf tmpC = "15" Then : MainProgram.ItemData_TYPE = "Kunai"
                                    ElseIf tmpC = "16" Then : MainProgram.ItemData_TYPE = "Javelin"
                                    ElseIf tmpC = "17" Then : MainProgram.ItemData_TYPE = "Spear"
                                    ElseIf tmpC = "18" Then : MainProgram.ItemData_TYPE = "Pike"
                                    ElseIf tmpC = "19" Then : MainProgram.ItemData_TYPE = "Doloire"
                                    ElseIf tmpC = "20" Then : MainProgram.ItemData_TYPE = "Ranseur"
                                    ElseIf tmpC = "21" Then : MainProgram.ItemData_TYPE = "Spetum"
                                    ElseIf tmpC = "22" Then : MainProgram.ItemData_TYPE = "Hasta"
                                    ElseIf tmpC = "23" Then : MainProgram.ItemData_TYPE = "Tepoztopilli"
                                    ElseIf tmpC = "24" Then : MainProgram.ItemData_TYPE = "Falcata"
                                    ElseIf tmpC = "25" Then : MainProgram.ItemData_TYPE = "Gladius"
                                    ElseIf tmpC = "26" Then : MainProgram.ItemData_TYPE = "Kopis"
                                    ElseIf tmpC = "27" Then : MainProgram.ItemData_TYPE = "Shortsword"
                                    ElseIf tmpC = "28" Then : MainProgram.ItemData_TYPE = "Broadsword"
                                    ElseIf tmpC = "29" Then : MainProgram.ItemData_TYPE = "Masakari"
                                    ElseIf tmpC = "30" Then : MainProgram.ItemData_TYPE = "Sappara"
                                    ElseIf tmpC = "31" Then : MainProgram.ItemData_TYPE = "Khopesh"
                                    ElseIf tmpC = "32" Then : MainProgram.ItemData_TYPE = "Longsword"
                                    ElseIf tmpC = "33" Then : MainProgram.ItemData_TYPE = "Flamberge"
                                    ElseIf tmpC = "34" Then : MainProgram.ItemData_TYPE = "Falchion"
                                    ElseIf tmpC = "35" Then : MainProgram.ItemData_TYPE = "Claymore"
                                    ElseIf tmpC = "36" Then : MainProgram.ItemData_TYPE = "Hatchet"
                                    ElseIf tmpC = "37" Then : MainProgram.ItemData_TYPE = "Axe"
                                    ElseIf tmpC = "38" Then : MainProgram.ItemData_TYPE = "Field Axe"
                                    ElseIf tmpC = "39" Then : MainProgram.ItemData_TYPE = "Rapier"
                                    ElseIf tmpC = "40" Then : MainProgram.ItemData_TYPE = "Scythe"
                                    ElseIf tmpC = "41" Then : MainProgram.ItemData_TYPE = "Chakrum"
                                    ElseIf tmpC = "42" Then : MainProgram.ItemData_TYPE = "Scimitar"
                                    ElseIf tmpC = "43" Then : MainProgram.ItemData_TYPE = "Cleaver"
                                    ElseIf tmpC = "44" Then : MainProgram.ItemData_TYPE = "Falx"
                                    ElseIf tmpC = "45" Then : MainProgram.ItemData_TYPE = "Rhomphaia"
                                    ElseIf tmpC = "46" Then : MainProgram.ItemData_TYPE = "Bardiche"
                                    ElseIf tmpC = "47" Then : MainProgram.ItemData_TYPE = "Bill"
                                    ElseIf tmpC = "48" Then : MainProgram.ItemData_TYPE = "Glaive"
                                    ElseIf tmpC = "49" Then : MainProgram.ItemData_TYPE = "Guisarme"
                                    ElseIf tmpC = "50" Then : MainProgram.ItemData_TYPE = "Voulge"
                                    ElseIf tmpC = "51" Then : MainProgram.ItemData_TYPE = "Staff"
                                    ElseIf tmpC = "52" Then : MainProgram.ItemData_TYPE = "Morning Star"
                                    ElseIf tmpC = "53" Then : MainProgram.ItemData_TYPE = "Macuahuiti"
                                    ElseIf tmpC = "54" Then : MainProgram.ItemData_TYPE = "Mace"
                                    ElseIf tmpC = "55" Then : MainProgram.ItemData_TYPE = "Flail"
                                    ElseIf tmpC = "56" Then : MainProgram.ItemData_TYPE = "Hammer"
                                    ElseIf tmpC = "57" Then : MainProgram.ItemData_TYPE = "War Hammer"
                                    ElseIf tmpC = "58" Then : MainProgram.ItemData_TYPE = "Scepter"
                                    ElseIf tmpC = "59" Then : MainProgram.ItemData_TYPE = "Club"
                                    ElseIf tmpC = "60" Then : MainProgram.ItemData_TYPE = "Blackjack"
                                    ElseIf tmpC = "61" Then : MainProgram.ItemData_TYPE = "Eku"
                                    ElseIf tmpC = "62" Then : MainProgram.ItemData_TYPE = "Sai"
                                    ElseIf tmpC = "63" Then : MainProgram.ItemData_TYPE = "Halberd"
                                    ElseIf tmpC = "64" Then : MainProgram.ItemData_TYPE = "Trident"
                                    ElseIf tmpC = "65" Then : MainProgram.ItemData_TYPE = "Kukri"
                                    ElseIf tmpC = "66" Then : MainProgram.ItemData_TYPE = "Lathi"
                                    ElseIf tmpC = "67" Then : MainProgram.ItemData_TYPE = "Whip"
                                    End If
                                ElseIf tmp1 = 3 And tmpB <> "2" Then 'material
                                    tmpC = Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1)
                                    tmpB = "2"
                                    If tmpC = "00" Then : MainProgram.ItemData_Material = "Magnesium"
                                    ElseIf tmpC = "01" Then : MainProgram.ItemData_Material = "Aluminium"
                                    ElseIf tmpC = "02" Then : MainProgram.ItemData_Material = "Duralumin"
                                    ElseIf tmpC = "03" Then : MainProgram.ItemData_Material = "Silumin"
                                    ElseIf tmpC = "04" Then : MainProgram.ItemData_Material = "Magnalium"
                                    ElseIf tmpC = "05" Then : MainProgram.ItemData_Material = "Alnico"
                                    ElseIf tmpC = "06" Then : MainProgram.ItemData_Material = "Potassium"
                                    ElseIf tmpC = "07" Then : MainProgram.ItemData_Material = "Iron"
                                    ElseIf tmpC = "08" Then : MainProgram.ItemData_Material = "Steel"
                                    ElseIf tmpC = "09" Then : MainProgram.ItemData_Material = "Chromoly"
                                    ElseIf tmpC = "10" Then : MainProgram.ItemData_Material = "Invar"
                                    ElseIf tmpC = "11" Then : MainProgram.ItemData_Material = "Cobalt"
                                    ElseIf tmpC = "12" Then : MainProgram.ItemData_Material = "Stellite"
                                    ElseIf tmpC = "13" Then : MainProgram.ItemData_Material = "Vitallium"
                                    ElseIf tmpC = "14" Then : MainProgram.ItemData_Material = "Nickel"
                                    ElseIf tmpC = "15" Then : MainProgram.ItemData_Material = "Chromel"
                                    ElseIf tmpC = "16" Then : MainProgram.ItemData_Material = "Nichrome"
                                    ElseIf tmpC = "17" Then : MainProgram.ItemData_Material = "Cupronickel"
                                    ElseIf tmpC = "18" Then : MainProgram.ItemData_Material = "Copper"
                                    ElseIf tmpC = "19" Then : MainProgram.ItemData_Material = "Billon"
                                    ElseIf tmpC = "20" Then : MainProgram.ItemData_Material = "Brass"
                                    ElseIf tmpC = "21" Then : MainProgram.ItemData_Material = "Tombac"
                                    ElseIf tmpC = "22" Then : MainProgram.ItemData_Material = "Bronze"
                                    ElseIf tmpC = "23" Then : MainProgram.ItemData_Material = "Hepatizon"
                                    ElseIf tmpC = "24" Then : MainProgram.ItemData_Material = "Shakudo"
                                    ElseIf tmpC = "25" Then : MainProgram.ItemData_Material = "Tumbaga"
                                    ElseIf tmpC = "26" Then : MainProgram.ItemData_Material = "Zinc"
                                    ElseIf tmpC = "27" Then : MainProgram.ItemData_Material = "Gallium"
                                    ElseIf tmpC = "28" Then : MainProgram.ItemData_Material = "Zirconium"
                                    ElseIf tmpC = "29" Then : MainProgram.ItemData_Material = "Silver"
                                    ElseIf tmpC = "30" Then : MainProgram.ItemData_Material = "Indium"
                                    ElseIf tmpC = "31" Then : MainProgram.ItemData_Material = "Tin"
                                    ElseIf tmpC = "32" Then : MainProgram.ItemData_Material = "Gold"
                                    ElseIf tmpC = "33" Then : MainProgram.ItemData_Material = "Mercury"
                                    ElseIf tmpC = "34" Then : MainProgram.ItemData_Material = "Lead"
                                    ElseIf tmpC = "35" Then : MainProgram.ItemData_Material = "Bismuth"
                                    ElseIf tmpC = "36" Then : MainProgram.ItemData_Material = "Uranium"
                                    ElseIf tmpC = "37" Then : MainProgram.ItemData_Material = "Agate"
                                    ElseIf tmpC = "38" Then : MainProgram.ItemData_Material = "Chrysoberyl"
                                    ElseIf tmpC = "39" Then : MainProgram.ItemData_Material = "Alexandrite"
                                    ElseIf tmpC = "40" Then : MainProgram.ItemData_Material = "Cymophane"
                                    ElseIf tmpC = "41" Then : MainProgram.ItemData_Material = "Emerald"
                                    ElseIf tmpC = "42" Then : MainProgram.ItemData_Material = "Bixbite"
                                    ElseIf tmpC = "43" Then : MainProgram.ItemData_Material = "Aquamarine"
                                    ElseIf tmpC = "44" Then : MainProgram.ItemData_Material = "Morganite"
                                    ElseIf tmpC = "45" Then : MainProgram.ItemData_Material = "Goshenite"
                                    ElseIf tmpC = "46" Then : MainProgram.ItemData_Material = "Golden Beryl"
                                    ElseIf tmpC = "47" Then : MainProgram.ItemData_Material = "Heliodor"
                                    ElseIf tmpC = "48" Then : MainProgram.ItemData_Material = "Maxixe"
                                    ElseIf tmpC = "49" Then : MainProgram.ItemData_Material = "Chrysocolla"
                                    ElseIf tmpC = "50" Then : MainProgram.ItemData_Material = "Chrysoprase"
                                    ElseIf tmpC = "51" Then : MainProgram.ItemData_Material = "Diamond"
                                    ElseIf tmpC = "52" Then : MainProgram.ItemData_Material = "Feldspar"
                                    ElseIf tmpC = "53" Then : MainProgram.ItemData_Material = "Garnet"
                                    ElseIf tmpC = "54" Then : MainProgram.ItemData_Material = "Hematite"
                                    ElseIf tmpC = "55" Then : MainProgram.ItemData_Material = "Jade"
                                    ElseIf tmpC = "56" Then : MainProgram.ItemData_Material = "Jasper"
                                    ElseIf tmpC = "57" Then : MainProgram.ItemData_Material = "Kunzite"
                                    ElseIf tmpC = "58" Then : MainProgram.ItemData_Material = "Lapis"
                                    ElseIf tmpC = "59" Then : MainProgram.ItemData_Material = "Malachite"
                                    ElseIf tmpC = "60" Then : MainProgram.ItemData_Material = "Obsidian"
                                    ElseIf tmpC = "61" Then : MainProgram.ItemData_Material = "Olivine"
                                    ElseIf tmpC = "62" Then : MainProgram.ItemData_Material = "Pyrite"
                                    ElseIf tmpC = "63" Then : MainProgram.ItemData_Material = "Citrine"
                                    ElseIf tmpC = "64" Then : MainProgram.ItemData_Material = "Ruby"
                                    ElseIf tmpC = "65" Then : MainProgram.ItemData_Material = "Sapphire"
                                    ElseIf tmpC = "66" Then : MainProgram.ItemData_Material = "Sugilite"
                                    ElseIf tmpC = "67" Then : MainProgram.ItemData_Material = "Tanzanite"
                                    ElseIf tmpC = "68" Then : MainProgram.ItemData_Material = "Topaz"
                                    ElseIf tmpC = "69" Then : MainProgram.ItemData_Material = "Turquoise"
                                    ElseIf tmpC = "70" Then : MainProgram.ItemData_Material = "Tourmaline"
                                    ElseIf tmpC = "71" Then : MainProgram.ItemData_Material = "Zircon"
                                    ElseIf tmpC = "72" Then : MainProgram.ItemData_Material = "Andalusite"
                                    ElseIf tmpC = "73" Then : MainProgram.ItemData_Material = "Benitoite"
                                    ElseIf tmpC = "74" Then : MainProgram.ItemData_Material = "Onyx"
                                    ElseIf tmpC = "75" Then : MainProgram.ItemData_Material = "Ammolite"
                                    ElseIf tmpC = "76" Then : MainProgram.ItemData_Material = "Coral"
                                    ElseIf tmpC = "77" Then : MainProgram.ItemData_Material = "Ivory"
                                    ElseIf tmpC = "78" Then : MainProgram.ItemData_Material = "Pearl"
                                    ElseIf tmpC = "79" Then : MainProgram.ItemData_Material = "Bone"
                                    ElseIf tmpC = "80" Then : MainProgram.ItemData_Material = "Lignite"
                                    ElseIf tmpC = "81" Then : MainProgram.ItemData_Material = "Platinum"
                                    ElseIf tmpC = "82" Then : MainProgram.ItemData_Material = "Palladium"
                                    ElseIf tmpC = "83" Then : MainProgram.ItemData_Material = "Glass"
                                    ElseIf tmpC = "84" Then : MainProgram.ItemData_Material = "Chestnut"
                                    ElseIf tmpC = "85" Then : MainProgram.ItemData_Material = "Basswood"
                                    ElseIf tmpC = "86" Then : MainProgram.ItemData_Material = "Dogwood"
                                    ElseIf tmpC = "87" Then : MainProgram.ItemData_Material = "Mahogany"
                                    ElseIf tmpC = "88" Then : MainProgram.ItemData_Material = "Maple"
                                    ElseIf tmpC = "89" Then : MainProgram.ItemData_Material = "Red Oak"
                                    ElseIf tmpC = "90" Then : MainProgram.ItemData_Material = "Rosewood"
                                    ElseIf tmpC = "91" Then : MainProgram.ItemData_Material = "Bamboo"
                                    End If
                                ElseIf tmp1 = 4 And tmpB <> "3" Then 'craftsmanship
                                    tmpC = Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1)
                                    tmpB = "3"
                                    If tmpC = "00" Then : MainProgram.ItemData_Craftsmanship = "Trash"
                                    ElseIf tmpC = "01" Then : MainProgram.ItemData_Craftsmanship = "Crude"
                                    ElseIf tmpC = "02" Then : MainProgram.ItemData_Craftsmanship = "Shoddy"
                                    ElseIf tmpC = "03" Then : MainProgram.ItemData_Craftsmanship = "Poor"
                                    ElseIf tmpC = "04" Then : MainProgram.ItemData_Craftsmanship = "Inferior"
                                    ElseIf tmpC = "05" Then : MainProgram.ItemData_Craftsmanship = "Adequate"
                                    ElseIf tmpC = "06" Then : MainProgram.ItemData_Craftsmanship = "Acceptable"
                                    ElseIf tmpC = "07" Then : MainProgram.ItemData_Craftsmanship = "Average"
                                    ElseIf tmpC = "08" Then : MainProgram.ItemData_Craftsmanship = "Fine"
                                    ElseIf tmpC = "09" Then : MainProgram.ItemData_Craftsmanship = "Exceptional"
                                    ElseIf tmpC = "10" Then : MainProgram.ItemData_Craftsmanship = "Flawless"
                                    ElseIf tmpC = "11" Then : MainProgram.ItemData_Craftsmanship = "Masterwork"
                                    End If
                                ElseIf tmp1 = 5 And tmpB <> "4" Then 'quality
                                    tmpC = Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1)
                                    tmpB = "4"
                                    If tmpC = "0" Then : MainProgram.ItemData_Quality = "Standard"
                                    ElseIf tmpC = "1" Then : MainProgram.ItemData_Quality = "Magical"
                                    ElseIf tmpC = "2" Then : MainProgram.ItemData_Quality = "Rare"
                                    ElseIf tmpC = "3" Then : MainProgram.ItemData_Quality = "Epic"
                                    End If
                                ElseIf tmp1 = 6 And tmpB <> "5" Then 'damage type
                                    Dim tmpAB As String = Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1)
                                    If tmpAB = "B" Then
                                        MainProgram.ItemData_DamageType = "Bash"
                                    ElseIf tmpAB = "S" Then
                                        MainProgram.ItemData_DamageType = "Slash"
                                    ElseIf tmpAB = "P" Then
                                        MainProgram.ItemData_DamageType = "Pierce"
                                    ElseIf tmpAB = "F" Then
                                        MainProgram.ItemData_DamageType = "Fist"
                                    ElseIf tmpAB = "E" Then
                                        MainProgram.ItemData_DamageType = "Exotic"
                                    End If
                                    tmpB = "5"
                                ElseIf tmp1 = 7 And tmpB <> "6" Then 'class req
                                    Dim tmpaa As String = Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1)
                                    If tmpaa = "No" Then
                                        MainProgram.ItemData_ClassRequirement = "None"
                                    ElseIf tmpaa = "Yes" Then
                                        MainProgram.ItemData_ClassRequirement = "ERROR HAS REQUIRED CLASS: NEEDS CONFIGURATION!"
                                    End If
                                    tmpB = "6"
                                ElseIf tmp1 = 8 And tmpB <> "7" Then 'aoe
                                    MainProgram.ItemData_AreaOfAffect = Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1)
                                    tmpB = "7"
                                ElseIf tmp1 = 9 And tmpB <> "8" Then 'damagedie+extra damage
                                    Dim tmp00 As Integer, tmp01 As Integer
                                    tmpC = Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1)
                                    For tmp00 = 1 To Len(tmpC) Step 1
                                        If Mid(tmpC, tmp00, 1) = "d" Then
                                            MainProgram.ItemData_DamageDie = Mid(tmpC, 1, tmp00 - 1)
                                            tmp01 = tmp00
                                        ElseIf Mid(tmpC, tmp00, 1) = "+" Then
                                            MainProgram.ItemData_DamageDieTypee = Mid(tmpC, tmp01 + 1, tmp00 - 1 - tmp01)
                                            MainProgram.ItemData_DamagePlus = Mid(tmpC, tmp00 + 1, Len(tmpC))
                                            Exit For
                                        End If
                                    Next
                                    tmpB = "8"
                                ElseIf tmp1 = 10 And tmpB <> "9" Then '2hand boolean
                                    If Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1) = "Y" Then
                                        MainProgram.ItemData_2Handed = "Yes"
                                    ElseIf Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1) = "N" Then
                                        MainProgram.ItemData_2Handed = "No"
                                    End If
                                    tmpB = "9"
                                ElseIf tmp1 = 11 And tmpB <> "10" Then 'levelreq
                                    MainProgram.ItemData_LevelRequirement = LTrim(Str(Val(Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1))))
                                    tmpB = "10"
                                    MainProgram.ItemData_SexRequirement = "None"
                                ElseIf tmp1 = 12 And tmpB <> "11" Then 'weight
                                    MainProgram.ItemData_Weight = Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1)
                                    tmpB = "11"
                                ElseIf tmp1 = 13 And tmpB <> "12" Then 'durabilitycount : durability %
                                    tmpC = Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1)
                                    MainProgram.ItemData_DurabilityCount = LTrim(Str(Val(Mid(tmpC, 1, 3))))
                                    MainProgram.ItemData_DurabilityPerc = LTrim(Str(Val(Mid(tmpC, 5, 3))))
                                    tmpB = "12"
                                ElseIf tmp1 = 14 And tmpB <> "13" Then 'affects | more affects , purchasable area(s)
                                    tmpC = Mid(tmpA, tmp3 + 1, tmp2 - tmp3 - 1)
                                    If LCase(tmpC) <> "none" Then
                                        If InStr(tmpC, "|") Then
                                            For tmp3 = 1 To Len(tmpC) Step 1
                                                If Mid(tmpC, tmp3, 1) = "|" Then
                                                    MainProgram.ItemData_Affect1 = Mid(tmpC, 1, tmp3 - 1)
                                                    MainProgram.ItemData_Affect2 = Mid(tmpC, tmp3 + 1, Len(tmpC))
                                                    Exit For
                                                End If
                                            Next
                                        Else
                                            MainProgram.ItemData_Affect1 = tmpC
                                            MainProgram.ItemData_Affect2 = "None"
                                        End If
                                    Else
                                        MainProgram.ItemData_Affect1 = "None"
                                        MainProgram.ItemData_Affect2 = "None"
                                    End If
                                    'purchasable area(s)
                                    MainProgram.ItemData_PurchasableAreas = Mid(tmpA, tmp2 + 1, Len(tmpA))
                                    tmpB = "13"
                                    Exit For
                                End If
                            Next
                        End If
                        Exit For
                    End If
                Next
                tempvar = InStr(MainProgram.ItemData, "WORTH#" + ItemVIRID + "(")
                For tempvar2 = InStr(MainProgram.ItemData, "WORTH#" + ItemVIRID + "(") To Len(MainProgram.ItemData) Step 1
                    If Mid(MainProgram.ItemData, tempvar2, 1) = ")" Then
                        MainProgram.ItemData_Worth = Mid(MainProgram.ItemData, tempvar + 7 + Len(LTrim(RTrim(ItemVIRID))), tempvar2 - (tempvar + 7 + Len(LTrim(RTrim(ItemVIRID)))))
                        Exit For
                    End If
                Next
            End If
        Else
            Debug.WriteLine("Error retrieving file: " & MainProgram.sErr)
        End If
    End Sub
End Module
